<!--grid-->
<br>
<div class="exchange-card-template">
    <div class="grid-header">
        <div class="grid-title">模板id</div>
        <div class="grid-title">有效期</div>
        <div class="grid-title">模板名称</div>
        <div class="grid-title">商品sn</div>
        <div class="grid-title">商品销售名</div>
        <div class="grid-title">兑换链接</div>
        <div class="grid-title">最后更新时间</div>
        <div class="grid-title">操作人</div>
        <div class="grid-title">已领数量</div>
        <div class="grid-title" style="width:7%">操作</div>
    </div>
    <div class="grid-container">
        <div class="grid-item" *ngFor="let row of rows">
            <div class="grid-itemInfo">{{row.id}}</div>
            <div class="grid-itemInfo">{{row.deadlineTime*1000 | date:'yyyy-MM-dd'}}</div>
            <div class="grid-itemInfo">{{row.name}}</div>
            <div class="grid-itemInfo">{{row.goodsSn}}</div>
            <div class="grid-itemInfo">{{row.goodsName}}</div>
            <div class="grid-itemInfo"><a href="{{row.url}}" target="_blank">{{row.url}}</a></div>
            <div class="grid-itemInfo">{{row.updateTime*1000 | date:'yyyy-MM-dd HH:mm:ss'}}</div>
            <div class="grid-itemInfo">{{row.updater}}</div>
            <div class="grid-itemInfo">{{row.generateCount}}</div>
            <div class="grid-itemInfo" style="width:7%">
                <button class="action-btn" (click)="openEditModal(row.id)">编辑</button>
                <button class="action-btn" *ngIf="row.generateCount>999999" disabled>领卡</button>
                <button class="action-btn" *ngIf="row.generateCount<999999">领卡</button>
            </div>
        </div>
    </div>
    <pagination *ngIf="rows" class="pagination-sm" [(ngModel)]="page" [totalItems]="totalItems" [itemsPerPage]="itemsPerPage"
        [maxSize]="maxSize" [boundaryLinks]="true" [rotate]="false" [firstText]="localText.firstBtn" [lastText]="localText.lastBtn"
        [previousText]="localText.previousBtn" [nextText]="localText.nextBtn" (pageChanged)="onChangeTable($event)" (numPages)="numPages = $event">
    </pagination>
    <pre *ngIf="rows" class="card card-block card-header">页数: {{page}} / {{numPages}}</pre>
</div>